package com.cskaoyan.controller;

import com.cskaoyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stone
 * @date 2022/09/05 16:35
 */
@RestController
public class UserController {

    @Autowired
    UserService userService;

    //localhost:8080/user/2
    @RequestMapping(value = "user/{id}",produces = "text/html;charset=utf-8")
    public String queryNameById(@PathVariable("id") Integer id) {
        String username = userService.query(id);

        return username;
    }
}
